import axios from "axios"

export default {
    namespaced: true,
    state: {
        tableData: [],
    },
    mutations: {
        //获取所有店铺
        getShops(state, data) {
            console.log(data)
            if(data===false){
                alert("当前平台没有门店，请等待门店管理员申请新门店")                        
            }else{

                state.tableData = data.filter(v=>v.status==2)
            }
           
             
        },
    },
    actions: {
        getAllShopsAsync(context) {
            axios
                .get("/shops") ///apply/getApply ,params({adminId:})
                .then(res => {
                    console.log(res)
                    context.commit("getShops", res.data)
                })
        }
    }
}